﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using EditUsers_Better.ManageUsersModule;
using System.Drawing;
using System.IO;
using System.Reflection;

namespace EditUsers_Better
{
    public static class ApplicationRoot
    {
        public static MainForm MainForm;

        /// <summary>
        /// Sets up the modules in the application.
        /// </summary>
        public static void Initialize()
        {
            // Initialise the Manage Users module
            using (FileStream fs = new FileStream(new FileInfo(Assembly.GetExecutingAssembly().GetName().CodeBase).DirectoryName + @"\ManageUsersIcon.ico", FileMode.Open))
            {
                ManageUsersView usersView = new ManageUsersView();
                TaskService.Instance.Register("Manage Users", usersView, new Icon(fs));

                // Initialise the Presenter for this view and wire them together
                usersView.Presenter = new ManageUsersPresenter(usersView, new MemoryUserRepository());
            }

            //...any other modules

        }
    }
}
